<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="TextureMaterial,com.derschmale.wick3d.materials.TextureMaterial,offsetU,offsetV,tileU,tileV,bitmapData,perspectiveCorrection,perspectiveDetail,smooth,drawTriangle,getUVCoords" name="keywords">
<title>com.derschmale.wick3d.materials.TextureMaterial</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'TextureMaterial - Wick3d Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Wick3d Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/derschmale/wick3d/materials/TextureMaterial.html&amp;com/derschmale/wick3d/materials/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;TextureMaterial</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class TextureMaterial"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.derschmale.wick3d.materials</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class TextureMaterial</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">TextureMaterial <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> <a href="AbstractMaterial.html">AbstractMaterial</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Implements</td><td><a href="IMaterial.html">IMaterial</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Subclasses</td><td><a href="../materials/DisplayObjectMaterial.html">DisplayObjectMaterial</a></td>
</tr>
</table>
<p></p>
  The TextureMaterial class is a material that maps an image to a triangle, adding detail to the surface.
  
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<div class="showHideLinks">
<div class="hideInheritedProperty" id="hideInheritedProperty">
<a onclick="javascript:setInheritedVisible(false,'Property');" href="#propertySummary" class="showHideLink"><img src="../../../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Public Properties</a>
</div>
<div class="showInheritedProperty" id="showInheritedProperty">
<a onclick="javascript:setInheritedVisible(true,'Property');" href="#propertySummary" class="showHideLink"><img src="../../../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Public Properties</a>
</div>
</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="AbstractMaterial.html#alpha">alpha</a> : Number<div class="summaryTableDescription">
   The transparency of this material.</div>
</td><td class="summaryTableOwnerCol"><a href="AbstractMaterial.html">AbstractMaterial</a></td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#bitmapData">bitmapData</a> : BitmapData<div class="summaryTableDescription">
   The BitmapData object to be used as the texture.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="AbstractMaterial.html#doubleSided">doubleSided</a> : Boolean<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol"><a href="AbstractMaterial.html">AbstractMaterial</a></td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="AbstractMaterial.html#interactive">interactive</a> : Boolean<div class="summaryTableDescription">
   Defines whether or not the triangles using this material are double sided.</div>
</td><td class="summaryTableOwnerCol"><a href="AbstractMaterial.html">AbstractMaterial</a></td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#offsetU">offsetU</a> : Number = 0<div class="summaryTableDescription">
   The horizontal offset in texture space.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#offsetV">offsetV</a> : Number = 0<div class="summaryTableDescription">
   The vertical offset in texture space.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#perspectiveCorrection">perspectiveCorrection</a> : Boolean<div class="summaryTableDescription">
   Defines whether the triangles should be subdivided to make the textures look more perspective correct.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#perspectiveDetail">perspectiveDetail</a> : int<div class="summaryTableDescription">
   The amount of times the triangles should be subdivided iteratively.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#smooth">smooth</a> : Boolean<div class="summaryTableDescription">
   Defines whether the texture data should be interpolated when mapped.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#tileU">tileU</a> : Number = 1<div class="summaryTableDescription">
   The horizontal downscaling of the texture, so the texture will be tiled.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#tileV">tileV</a> : Number = 1<div class="summaryTableDescription">
   The vertical downscaling of the texture, so the texture will be tiled.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#TextureMaterial()">TextureMaterial</a>(bitmapData:BitmapData, smooth:Boolean = false)</div>
<div class="summaryTableDescription">
   Creates a TextureMaterial instance.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#drawTriangle()">drawTriangle</a>(triangle:<a href="../core/geometry/Triangle3D.html">Triangle3D</a>, target:Graphics):void</div>
<div class="summaryTableDescription">
   Renders a Triangle3D to the target Graphics object.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getUVCoords()">getUVCoords</a>(x:Number, y:Number, triangle:<a href="../core/geometry/Triangle3D.html">Triangle3D</a>):Point</div>
<div class="summaryTableDescription">
   Retrieves the material's texture coordinates for the 2D viewport coordinates.</div>
</td><td class="summaryTableOwnerCol">TextureMaterial</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="bitmapData"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">bitmapData</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>bitmapData:BitmapData</code>&nbsp;&nbsp;[read-write]<p>
   The BitmapData object to be used as the texture.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get bitmapData():BitmapData</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set bitmapData(value:BitmapData):void</code>
<br>
</div>
<a name="offsetU"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">offsetU</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var offsetU:Number = 0</code><p>
   The horizontal offset in texture space. For example, a value of 0.5 will move the texture half its width to the right
   </p></div>
<a name="offsetV"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">offsetV</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var offsetV:Number = 0</code><p>
   The vertical offset in texture space. For example, a value of 0.5 will move the texture half its height down.
   </p></div>
<a name="perspectiveCorrection"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">perspectiveCorrection</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>perspectiveCorrection:Boolean</code>&nbsp;&nbsp;[read-write]<p>
   Defines whether the triangles should be subdivided to make the textures look more perspective correct.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get perspectiveCorrection():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set perspectiveCorrection(value:Boolean):void</code>
<br>
</div>
<a name="perspectiveDetail"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">perspectiveDetail</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>perspectiveDetail:int</code>&nbsp;&nbsp;[read-write]<p>
   The amount of times the triangles should be subdivided iteratively. Higher values will look more correct, but will be slower. This parameter has no effect if perspectiveCorrection is set to false. Default value is 2. 
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get perspectiveDetail():int</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set perspectiveDetail(value:int):void</code>
<br>
</div>
<a name="smooth"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">smooth</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>smooth:Boolean</code>&nbsp;&nbsp;[read-write]<p>
   Defines whether the texture data should be interpolated when mapped.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get smooth():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set smooth(value:Boolean):void</code>
<br>
</div>
<a name="tileU"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">tileU</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var tileU:Number = 1</code><p>
   The horizontal downscaling of the texture, so the texture will be tiled. For example, a value of 2 will scale the texture's width by half, providing a tile of 2.
   </p></div>
<a name="tileV"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">tileV</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var tileV:Number = 1</code><p>
   The vertical downscaling of the texture, so the texture will be tiled. For example, a value of 2 will scale the texture's height by half, providing a tile of 2.
   </p></div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="TextureMaterial()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">TextureMaterial</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function TextureMaterial(bitmapData:BitmapData, smooth:Boolean = false)</code><p>
   Creates a TextureMaterial instance.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">bitmapData</span>:BitmapData</code> &mdash; The BitmapData object to be used as the texture.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">smooth</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Defines whether the texture should be smoothed when drawing or not.
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="drawTriangle()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">drawTriangle</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public override function drawTriangle(triangle:<a href="../core/geometry/Triangle3D.html">Triangle3D</a>, target:Graphics):void</code><p>
   Renders a Triangle3D to the target Graphics object.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">triangle</span>:<a href="../core/geometry/Triangle3D.html">Triangle3D</a></code> &mdash; The Triangle3D object to be rendered.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:Graphics</code> &mdash; The Graphics instance that will be drawn to.
   
   </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../core/geometry/Triangle3D.html" target="">com.derschmale.wick3d.core.geometry.Triangle3D</a>
</div>
</div>
<a name="getUVCoords()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getUVCoords</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public override function getUVCoords(x:Number, y:Number, triangle:<a href="../core/geometry/Triangle3D.html">Triangle3D</a>):Point</code><p>
   Retrieves the material's texture coordinates for the 2D viewport coordinates.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code> &mdash; The x-coordinate in Viewport coordinates.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code> &mdash; The y-coordinate in Viewport coordinates.
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">triangle</span>:<a href="../core/geometry/Triangle3D.html">Triangle3D</a></code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Point</code> &mdash; A Point representing the material's coordinates for the 2D viewport coordinates.
   </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
